﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using YmtSystem.CrossCutting;

namespace YmtAuth.Domain.Model.Safe
{
    /// <summary>
    /// 默认处理策略
    /// </summary>
    public class DefaultSafeHandle
    {
        public class _DefaultNeedVerifyHandle : SafeVerifyStrategyBase
        {
            public override string ToString()
            {
                return "* DefaultVerify-DefaultVerifyHandle*";
            }

            public override AuthSafeHandleCode Execute(UserLoginParameter par, UserLoginAuthRepository repo,
                AuthSafeConfiguration cfg)
            {
                YmatouLoggingService.Debug("!!!DefaultVerifyHandle forever NeedIdentityVerify");
                return AuthSafeHandleCode.CreateCode(AuthSafeHandleCode.NeedIdentityVerify,
                    AuthSafeHandleCode.NeedIdentityVerify, "NeedIdentityVerify");
            }
        }
        public class _DefaultSkipVerifyHandle : SafeVerifyStrategyBase
        {
            public override string ToString()
            {
                return "* DefaultVerify-DefaultVerifyHandle*";
            }

            public override AuthSafeHandleCode Execute(UserLoginParameter par, UserLoginAuthRepository repo,
                AuthSafeConfiguration cfg)
            {
                YmatouLoggingService.Debug("!!!DefaultVerifyHandle Skip NeedIdentityVerify");
                return AuthSafeHandleCode.CreateCode(AuthSafeHandleCode.AllowLogin,
                    AuthSafeHandleCode.AllowLogin, "AllowLogin");
            }
        }
    }
}
